<?php 
		$user=$session->read('User');
		$colleageid=$session->read("colleageid");
?>
<div class="right_side_operate_area">

	<div class="right_side_title left">
		<h2>
			<?php 
					$colleagename=$session->read("colleagename");
					echo $html->link($colleagename,"/colleages/showcolleageinfo/".$colleageid);
			?>
		</h2>
		<div class="clear"></div>
	</div>
	
    <div class="right item_add_btn">
    <?php 
    	if($form->value('CgAwardproject.id'))
    	{
    		$str_title=__("Edit",true);
		}
		else
		{
			$str_title=__("Add",true);
		}
		echo $html->link(__("Cancel",true).$str_title,"/colleages/awardprojects/");
    ?>
    </div>
    <div class="clear"></div>
    
</div>


<div class="right_side_scollbar">
    <div class="detail_info_panel">
    	<?php echo $form -> create('cgawardproject', array('url' => '/colleages/editawardproject/','enctype'=>'multipart/form-data','type'=> 'post','onsubmit'=>'return checksave()') ); ?>
    
    	<div class="details_item_line">
		      <div class="details_item">
			      <div class="form_left_title left">项目名称：</div>
			      <div class="form_right_e_input left"><?php echo $form->text('CgAwardproject.name');?></div>
			       <div id='namemessage' style='display:none;' class="error_message">请填写项目名称</div>
		      </div>
		</div>
		
		<div class="details_item_line">
			<div class="details_item">
			    <div class="form_left_title left">获奖时间：</div>
			    <div class="form_right_e_input form_date_picker left">
			    	<?php echo $form->text('CgAwardproject.award_time',array("maxlength"=>"10","style"=>"width:130px","onfocus"=>"WdatePicker()"));?>
			    </div>
			    <div id='timemessage' style='display:none;' class="error_message">请选择建立时间</div>
			</div>
	   </div>
	   
	   <div class="details_item_line">
	      <div class="details_item">
		      <div class="form_left_title left">应用描述：</div>
		      <div class="form_right_e_input left"><?php echo $form->textarea('CgAwardproject.apply_describe',array('class' => 'form_textarea'));?></div>
	      </div>
		</div>
		
		<!--核心技术 开始-->
       <div class="details_item_line">
             <div class="details_item">
                <div class="form_left_title left">核心技术：</div>
                <div class="form_right_e_input left">
                <?php 
		                if(!empty($photo))
		                {
			                $photoimg=$photo["file_path"];
			                if($photoimg)
			                {
			                	echo $html->image("/".$photoimg,array("width"=>"200px","height"=>"80px")).'<br/>';
			                }
		                }
                ?>
                <input type="file" name="AwardprojectPicture[]" />
                </div>
       		</div>
       	</div>
       <!--核心 结束-->
       
        <div class="details_item_line">
	      <div class="details_item">
		      <div class="form_left_title left">经济指标：</div>
		      <div class="form_right_e_input left"><?php echo $form->textarea('CgAwardproject.economic_target',array('class' => 'form_textarea'));?></div>
	      </div>
		</div>
		
		 <div class="details_item_line">
	      <div class="details_item">
		      <div class="form_left_title left">使用案例：</div>
		      <div class="form_right_e_input left"><?php echo $form->textarea('CgAwardproject.usecase',array('class' => 'form_textarea'));?></div>
	      </div>
		</div>
		
	 <div class="details_item_line">
		<div class="details_item">
			<div class="form_left_title left"></div>
	        <div class="form_add_submit left">
	        	<?php echo $form->submit(__('Save',true), array("id"=>"addactive","name"=>"submit","class"=>"buttom","div"=>false));  ?>
	            <?php echo $form->hidden('CgAwardproject.colleage_id',array("value"=>$colleageid)) ;?>
	        	<?php echo $form->hidden('CgAwardproject.id') ?>
	        </div>
		</div>
	  </div>
    
    </div>
</div>

<?php echo $this->element('delfileconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>
<script>
function checksave()
{
	 if($("#CgAwardprojectName").val().trim() == '')
	 {
			$("#namemessage").css('display','block');
			return false;
	  }
	  else
	  {
		 	 $("#namemessage").css('display','none');
	  }
	
	 if($("#CgAwardprojectAwardTime").val().trim() == '')
	 {
		 $("#timemessage").css('display','block');
		return false;
	 }
	 else
	 {
		 $("#timemessage").css('display','none');
	 } 	  
} 
</script>